
/*object zuoye {
  def main(args: Array[String]): Unit = {
    val spark = SparkSession.builder().master("local[*]").appName("sparkBse").getOrCreate()
    val sc = spark.sparkContext
    val rdd: RDD[Int] = sc.makeRDD(List(1, 2, 3, 4, 5), 1)
    val mapRDD = rdd.map(num => num + 2).sortBy(tp => tp)
    mapRDD.foreach(System.out.println)

    val first_half = sc.textFile("D:\\Employee_salary_first_half.csv")
    val drop_first = first_half.mapPartitionsWithIndex ((ix.it) => {
      if (ix == 0) it.drop(1)
      else it
    })
    val split_first = drop_first.map(line => {
      val data = line.split(",");
      (data(1), data(6).toInt)
    })
    val sort_first = split_first.sortBy(_._2, ascending = false).take(3)
    sort_first.take(3).foreach(println)
    sc.stop()
  }



}
*/